package com.gxa.system_setting.controller;

import com.gxa.common.R;
import com.gxa.common.entity.system_settings.HorsemanSalary;
import com.gxa.system_setting.service.HorsemanSalaryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class HorsemanSalaryController {

    @Autowired
    private HorsemanSalaryService horsemanSalaryService;

    //分页
    @GetMapping("/queryHorsemanSalaryList")
    public R queryHorsemanSalaryList(Integer currentPage,Integer pageSize){
       return horsemanSalaryService.queryHorsemanSalaryList(currentPage,pageSize);
    }
    //修改
    @PostMapping("/updateById")
    public R updateById(@RequestBody HorsemanSalary horsemanSalary){
      return   horsemanSalaryService.updateById(horsemanSalary);
    }
    //禁用或者启用
    @GetMapping("/stopOrUseForHorse")
    public R stopOrUse(Long horseman_salary_id,Long flag){
       return horsemanSalaryService.stopOrUse(horseman_salary_id,flag);
    }
    //条件查询
    @GetMapping("/queryHorseByScopeOrStatus")
    public R queryHorseByScopeOrStatus(String scope_application,Long status){
        return horsemanSalaryService.queryHorseByScopeOrStatus(scope_application,status);
    }
    //添加
    @PostMapping("/insertHorse")
    public R insertHorse(@RequestBody HorsemanSalary horsemanSalary){
        return horsemanSalaryService.insertHorse(horsemanSalary);
    }
}
